package org.serv;

public class Commande {
	
	private int idArticle;
	private int nbArticle;
	private float prixArticle;
	
	public Commande () {}

	public Commande(int idArticle, int nbArticle, float prixArticle) {
		this();
		this.idArticle = idArticle;
		this.nbArticle = nbArticle;
		this.prixArticle = prixArticle;
	}
	
	public float getPrixTotal ()
	{
		return (float) (prixArticle*nbArticle);
	}
	
	public int getId ()
	{
		return idArticle;
	}
	
	public int getNombre ()
	{
		return nbArticle;
	}
	
	public void updateNombre (int plus)
	{
		nbArticle += plus;
	}
	
	public float getPrix ()
	{
		return prixArticle;
	}
	
	public String toString ()
	{
		return "Article " + idArticle + ", Quantité x " + nbArticle + ", Sous-total = " + prixArticle*nbArticle;
	}
}
